// 给服务器发送要求为1024字节的数据，但是实际不足1024字节
// 服务器没有接收全部数据，客户端无法得到响应
#include "http.hpp"
int main()
{
    // 测试正常处理请求
    std::unique_ptr<Socket> client(new Socket);
    std::string req = "get /hello HTTP/1.1\r\nConnection: keep-alive\r\nContent-Length: 0\r\n\r\nhello";
    client->CreateClient(8888, "127.0.0.1");
    client->Send(req.c_str(),req.size());
    client->Send(req.c_str(),req.size());
    client->Send(req.c_str(),req.size());
    client->Send(req.c_str(),req.size());
    while (1)
    {
        client->Send(req.c_str(),req.size());
        char buffer[1024]={0};
        if (client->Recv(buffer, 1023) == -1)
        {
            INFO_LOG("断开连接退出");
            break;
        }
        INFO_LOG("收到数据:[%s]",buffer);
        sleep(3);
    }
    client->Close();
    return 0;
}